﻿import java.util.Scanner;

public class prac_01 {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		System.out.println("请输入第一个操作数：");
		if(sc.hasNextDouble()){
			double num1 = sc.nextDouble();
			System.out.println("请输入第二个操作数：");
			if(sc.hasNextDouble()){
				double num2 = sc.nextDouble();
				System.out.println("请选择运算符：");
				String choose = sc.next();
				switch(choose){
				case "+":
					System.out.println(num1+num2);
					break;
				case "-":
					System.out.println(num1-num2);
					break;
				case "*":
					System.out.println(num1*num2);
					break;
				case "/":
					System.out.println(num1/num2);
					break;
				case "%":
					System.out.println(num1%num2);
					break;
				default:
					System.out.println("请选择正确的算数符！");
				}
			}else{
				System.out.println("请输入正确的数字！");
			}
		}else{
			System.out.println("请输入正确的数字！");
		}
	}

}